//
//  YXCell.swift
//  Cell动画弹跳
//
//  Created by Rookie_YX on 16/7/18.
//  Copyright © 2016年 YX_Rookie. All rights reserved.
//

import UIKit
import SnapKit

class YXCell: UITableViewCell {
  
  var imgV = UIImageView()
  var scriptL = UILabel()
  
  init(style: UITableViewCellStyle, reuseIdentifier: String?, frame:CGRect) {
    super.init(style: style, reuseIdentifier: reuseIdentifier)
    
    self.selectionStyle = .None
    contentView.frame = frame
    // UI
    contentView.addSubview(imgView)
  
    imgView.snp_makeConstraints { (make) in
      make.top.equalTo(contentView.snp_top)
      make.left.equalTo(contentView.snp_left)
      make.size.equalTo(CGSizeMake(contentView.frame.width, contentView.frame.height))
    }
  }
  
  override func layoutSubviews() {
    print(self.center)
  }

  required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }
  
  private lazy var imgView: UIImageView = {
    let iv = UIImageView()
    iv.backgroundColor = UIColor.orangeColor()
    self.imgV = iv
    return iv
  }()
  
}
